function sum(a: number, b: number): number{
  return a + b
}

console.log(sum(1, 3))


function getData(name: string, age?:number){
  if(age === undefined){
    age = 18
  }
  return `I am ${name}, I am ${age} years old.`
}

console.log(getData('张三', 20))
console.log(getData('张三'))


function getData02(name: string, age: number = 38){
  return `I am ${name}, I am ${age} years old.`
}

console.log(getData02('张三', 20))
console.log(getData02('张三'))

let arr: number[] = [1,2,3,4,5,6]

arr.forEach(item => console.log(item))
